package com.dk.util;

public class Result<T> {

    private Integer code;

    private String message;

    private T date;

    public static Result ok(){
        return  new Result(200,"操作成功");
    }

    public static Result fallback(){
        return  new Result(500,"熔断了");
    }

    public Result(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Result(Integer code, String message, T date) {
        this.code = code;
        this.message = message;
        this.date = date;
    }

    public Result() {
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getDate() {
        return date;
    }

    public Result<T> setDate(T date) {
        this.date = date;
        return this;
    }
}
